import yayJpg from "../assets/yay.jpg";
import React from "react";
import './index.less'
import { history } from "umi";
import { Link } from "react-router-dom";
import { Grid,Icon } from 'saltui';
import User from 'salt-icon/lib/User';
import Time from 'salt-icon/lib/Time';
import Map from 'salt-icon/lib/Map';
import Star from 'salt-icon/lib/Star';
import Pen from 'salt-icon/lib/Pen';
import InfoCircle from 'salt-icon/lib/InfoCircle';
import PlusCircle from 'salt-icon/lib/PlusCircle';
import Search from 'salt-icon/lib/Search';
import Plus from 'salt-icon/lib/Plus';

class Demo extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      n: 1,
      list: [0, 1, 2, 3, 4, 5, 6],
    };
  }

  add() {
    const t = this;
    t.setState({
      n: t.state.n + 1,
    });
  }

  render() {
    const t = this;
  return (
    <div>
      <Link to={"/user"}>
        <button>去user</button>
      </Link>
      {/* <p>
        <img src={yayJpg} width="388" />
      </p> */}
      {/* <button onClick={()=>props.history.push('/user')}>去user</button> */}
      <Grid col={4} className="t-BCf t-MB30" square noLine touchable>
          <div className="demo" onClick={() => { t.add(); }}>
          <Link to={"/user"}>
            <User fill={'#42A5F5'} />
            <div className="menu-title">Demo</div>
            </Link> 
          </div>
          <div className="demo" onClick={() => { t.add(); }}>
            <Time fill={'#FF8A65'} />
            <div className="menu-title">时钟</div>
          </div>
          <div className="demo" onClick={() => { t.add(); }}>
            <Star fill={'#EA80FC'} />
            <div className="menu-title">星星</div>
          </div>
          <div className="demo" onClick={() => { t.add(); }}>
            <Map fill={'#EF9A9A'} />
            <div className="menu-title">地图</div>
          </div>
          <div className="demo" onClick={() => { t.add(); }}>
            <Pen fill={'#9FA8DA'} />
            <div className="menu-title">编辑</div>
          </div>
          <div className="demo" onClick={() => { t.add(); }}>
            <InfoCircle fill={'#80DEEA'} />
            <div className="menu-title">信息</div>
          </div>
          <div className="demo" onClick={() => { t.add(); }}>
            <PlusCircle fill={'#DCE775'} />
            <div className="menu-title">添加</div>
          </div>
          <div className="demo" onClick={() => { t.add(); }}>
            <Search fill={'#A1887F'} />
            <div className="menu-title">搜索</div>
          </div>
          <div className="demo" onClick={() => { t.add(); }}>
            <Plus fill={'#BDBDBD'} />
          </div>
        </Grid>
    </div>
  );
  }
}

export default Demo
